#ifndef MAP_H_
#define MAP_H_

#include <iostream>
#include <vector>

#define PLAYER1 -6
#define PLAYER2 -5
#define WATER -4
#define ISLAND -3
#define SELECTED_ISLAND -2
#define HIGH_ISLAND -1



using namespace std;

class Map {
private:
	string heightMapFilePath;

	vector<vector<int> > heightMap;
	vector<vector<int> > islandMap;

	vector<pair<int,int> > selectedIslands;

	float heightMapWidth,heightMapHeight;
	float seaLevel;
	float mapDimensionX,mapDimensionY,mapDimensionZ;

public:
	Map();
	~Map();

	//after GamePlay
	void fromPpmValuestoMapValues();

	//before Game Play
	void draw();
	void drawIslands();
	void init();

	string getHeightMapFilePath() {return heightMapFilePath;};
	float getSeaLevel(){return seaLevel;};
	float getMapDimensionX(){return mapDimensionX;};
	float getMapDimensionY(){return mapDimensionY;};
	float getMapDimensionZ(){return mapDimensionZ;};

	float getHeightMapHeight(){return heightMapHeight;};
	float getHeightMapWidth(){return heightMapWidth;};

	vector<vector<int> >& getIslandMap(){return islandMap;};
	vector<vector<int> >& getHeightMap(){return heightMap;};

	void setMapDimensionX(float x){mapDimensionX=x;};
	void setMapDimensionY(float y){mapDimensionY=y;};
	void setMapDimensionZ(float z){mapDimensionZ=z;};
	void setHeightMapFilePath(string path) {heightMapFilePath=path;};


	void floodFillIsland(int x, int y, int fillValue, int replaceValue);
	void setIslandMap(vector<vector<int> > isle){islandMap=isle;};
	void reloadHeightMap();
	void setSeaLevel();
	void setSeaLevel(int level){seaLevel=level;};
	void selectIsland(float x,float y, float left, float right, float bottom, float top);


	vector<pair<int,int> > getSelectedIslands();
	void resetSelectedIslands();
	void setSelectedIslands(int i);
};

#endif /* MAP_H_ */
